#!/usr/bin/env python
#pip install matplotlib -i https://mirrors.aliyun.com/pypi/simple/
from matplotlib import pyplot as plt
import random
"""
from matplotlib import font_manager

my_font = font_manager.FontProperties(family="...")
"""
import matplotlib

# matplotlib.rc("font",family='MicroSoft YaHei')

font = {'family' : 'MicroSoft YaHei','size':'12'}
matplotlib.rc("font",**font)


x = range(0,120)
y = [random.randint(20,35) for i in range(120)]

plt.figure(figsize=(20,10),dpi=60)

plt.plot(x,y)
 
#调整X轴的刻度
# _x = list(x)[::10] 
# _xtick_labels = ["hello,{}".format(i) for i in _x]
# plt.xticks(_x,_xtick_labels)

_x = list(x)
_xtick_labels = ["10点{}分".format(i) for i in range(60)]
_xtick_labels += ["11点{}分".format(i-60) for i in range(60,120)]
plt.xticks(_x[::3] ,_xtick_labels[::3], rotation='vertical')

plt.xlabel("时间")
plt.ylabel("温度 单位(c)")
plt.title("10点到12点，每分钟的气温变化情况")

plt.show()